﻿namespace Agile.Infra.Pay.WxPay.Models
{
    public class WxProfitSharingResponse
    {
        public bool Success { get; set; }
        public string Message { get; set; }

        public string OrderID { get; set; }

        /// <summary>分账单状态  1、PROCESSING：处理中  2、FINISHED：分账完成 </summary> 
        public string State { get; set; }

        /// <summary>分账接收方列表</summary> 
        public List<WxProfitSharingReceiverResponse> Receivers { get; set; }
    }

    public class WxProfitSharingReceiverResponse
    {
        /// <summary>分账接收方类型  	
        /// 1、MERCHANT_ID：商户号
        /// 2、PERSONAL_OPENID：个人openid（由父商户APPID转换得到）
        /// 示例值：MERCHANT_ID
        /// </summary> 
        public string Type { get; set; }

        /// <summary>分账接收方帐号</summary> 
        public string Account { get; set; }

        /// <summary>分账金额，单位为分，只能为整数，不能超过原订单支付金额及最大分账比例金额</summary> 
        public int Amount { get; set; }

        /// <summary>分账描述</summary> 
        public string Description { get; set; }

        /// <summary>分账结果 1、PENDING：待分账 2、SUCCESS：分账成功 3、CLOSED：已关闭</summary> 
        public string Result { get; set; }

        /// <summary>分账失败原因
        /// 分账失败原因。包含以下枚举值：
        /// 1、ACCOUNT_ABNORMAL : 分账接收账户异常
        /// 2、NO_RELATION : 分账关系已解除
        /// 3、RECEIVER_HIGH_RISK : 高风险接收方
        /// 4、RECEIVER_REAL_NAME_NOT_VERIFIED : 接收方未实名
        /// 5、NO_AUTH : 分账权限已解除
        /// 示例值：ACCOUNT_ABNORMAL 
        /// </summary> 
        public string FailReason { get; set; }

        /// <summary>分账创建时间</summary> 
        public string CreateTime { get; set; }

        /// <summary>分账完成时间</summary> 
        public string FinishTime { get; set; }
    }
}
